package ro.isdc.training.ejb3.systemuser.service.domain;

import ro.isdc.training.ejb3.misc.service.domain.ServiceResponse;
import ro.isdc.training.ejb3.systemuser.domain.SystemUser;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * The service response of the createSystemUser() service.
 * 
 * @author Andrei Chirila
 */
public class CreateSystemUserResponse extends ServiceResponse {
  /**
   * Generated Serial Version UID
   */
  private static final long serialVersionUID = 1655767161622336207L;
  
  /**
   * The created System User
   */
  private SystemUser systemUser;

  /**
   * @return the systemUser
   */
  public SystemUser getSystemUser() {
    return systemUser;
  }

  /**
   * @param systemUser the systemUser to set
   */
  public void setSystemUser(final SystemUser systemUser) {
    this.systemUser = systemUser;
  }

  /**
   * @see java.lang.Object#equals(Object)
   */
  public boolean equals(final Object object) {
    if (object == this) {
      return true;
    }
    if (!(object instanceof CreateSystemUserResponse)) {
      return false;
    }
    CreateSystemUserResponse rhs = (CreateSystemUserResponse) object;
    return new EqualsBuilder().append(this.systemUser, rhs.systemUser)
        .isEquals();
  }

  /**
   * @see java.lang.Object#hashCode()
   */
  public int hashCode() {
    return new HashCodeBuilder(1319952345, 961155487).append(this.systemUser)
        .toHashCode();
  }

  /**
   * @see java.lang.Object#toString()
   */
  public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append(
        "systemUser", this.systemUser).toString();
  }

}
